$(document).ready(function() {

	$('#busqueda').bind('textchange', function(event, previousText) {
		$('#lstPacientes').html('Cargando...');
		$.post(
			'pacientes/search',
			{'busqueda': $(this).val()},
			function(response) {
				$('#lstPacientes').html(response);
			},
			'html'
		);
	});

	/*
	// jQuery Tipsy
	$('[rel=tooltip]').click(function(event) {

		$('.tipsy').each(function() {
			$(this).css({visibility: 'hidden'})
		});

		tip = $('<div class="tipsy"><div class="tipsy-inner"><ul><li>Abrir ficha</li><li>Generar factura</li></ul></div></div>');
		tip.css({position: 'absolute', zIndex: 100000});
		$.data($(this), 'active.tipsy', tip);

		var pos = $.extend({}, {left: event.pageX, top: event.pageY}, {width: $(this).offsetWidth, height: $(this).offsetHeight});
		tip.get(0).className = 'tipsy'; // reset classname in case of dynamic gravity
		tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
		var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;
		tip.css({top: pos.top - actualHeight, left: pos.left - actualWidth / 2, visibility: 'visible'}).addClass('tipsy-south');

	});
	*/

});
